package org.halk.mq;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.halk.mq.entity.Hello;
import org.springframework.stereotype.Component;

/**
 * @Author halk
 * @Date 2023/8/21 16:00
 */
@Slf4j
@Component
@RocketMQMessageListener(topic = HelloConsumer.TOPIC_HELLO, consumerGroup = HelloConsumer.TOPIC_HELLO)
public class HelloConsumer implements RocketMQListener<Hello> {

    static final String TOPIC_HELLO = "Halk_Hello";

    @Override
    public void onMessage(Hello hello) {
        System.out.println("receiver message: " + hello);
    }
}
